package com.xiaoyu.lanling.feature.im.request.flow

import com.xiaoyu.im.provider.ConversationManager
import com.xiaoyu.im.provider.MessageStatusProcessor
import com.xiaoyu.im.request.MessageRequest
import com.xiaoyu.im.request.flow.BaseSuccessAction
import com.xiaoyu.lanling.feature.im.provider.MessageDataProvider

class SuccessAction : BaseSuccessAction() {

    override fun onSuccess(request: MessageRequest) {
        super.onSuccess(request)
        MessageStatusProcessor.getInstance().removeSending(request.localId)
        MessageDataProvider.instance.onMessageSent(request)
        ConversationManager.getInstance().sendLatestMessageReceipt(request.chatId)
    }
}